<extend name="Common@Base/layout"/>
<block name="body">
    <form id="paging_form" name="paging_form" method="post" action="/evaluating/score/index">

        <div class="main-content main-pagebar-content">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-sm-12">
                        <h3 class="mod-title">
                            <span class="t">
                                年终评测评分

                                </span>
                        </h3>
                        <div class="panel panel-default">
                            <div class="panel-body panel-body-up-table">
                                <div class="search-panel">
                                    <div class="search">

                                        <div class="btn-group">
                                            <input name="search_key" type="text" class="form-control" value="{$_page->parameter['search_key']|urldecode}"
                                                   placeholder="请输入标题">
                                        </div>
                                        <div class="btn-group">
                                            <button type="submit">搜索</button>
                                        </div>
                                    </div>

                                </div>

                            </div>
                            <div class="table-responsive">
                                <table class="table-check table-link-hover table table-striped table-bordered table-hover">
                                    <thead>
                                    <tr>
                                        <th class="text-center" style="width:10px">序号</th>
                                        <th style="width:50%">标题</th>
                                        <th>发布单位</th>
                                        <th class="text-center" style="width:6%">总数</th>
                                        <th class="text-center" style="width:6%">已评数</th>
                                        <th class="text-center" style="width:6%">已审数</th>
                                        <th class="text-right">发布时间</th>
                                        <th class="text-right" style="width:6%"></th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <volist name="task_list" id="task">
                                        <tr data-vid="{$task.id}">
                                            <td class="text-center">{$i}</td>
                                            <td>
                                                <div class="truncate-b" title="{$task.title}">
                                                    {$task.title}
                                                </div>
                                            </td>
                                            <td>{$task.promulgator}</td>

                                            <td class="text-center">{$task.all_user_task|count}</td>
                                            <td class="text-center">{$task.score_user_task|count}</td>
                                            <td class="text-center">{$task.review_user_task|count}</td>
                                            <td class="text-right">{$task.create_at|fc_get_date}</td>
                                            <td class="td-action">
                                                <a class="td-btn" href="/evaluating/review/detail?taskid={$task.id}&search_status=3" role="button">明细</a>
                                            </td>
                                        </tr>
                                    </volist>
                                    </tbody>
                                </table>
                                <input class="checked-item" type="hidden">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="main-pagebar">
            <include file="Common@Public/paging"/>
        </div>

    </form>

    <script>
        $(document).ready(function () {
            $('#nav-evaluating').addClass("active");
            var vx = $("#search_status").val();
            if (vx != "") {
                $("#search_status").prev().find('a').each(function () {
                    var $this = $(this);
                    if ($this.data('value') == vx) {
                        $("#search_status_name").text($this.text());
                    }
                });
            }

            $('a[data-type="delete-info"]').click(function () {
                var $tr = $(this).parent().parent();
                alertify.confirm("确定操作？", function (e) {
                    if (e) {
                        var url = "/set/task/delete";
                        var data = "id=" + $tr.attr('data-vid');
                        $.ajax({
                            type: "GET",
                            url: url,
                            data: data,
                            success: function (data) {
                                if (data == "0") {
                                    alertify.alert("操作成功!", function () {
                                        location.reload();
                                    });

                                } else {
                                    alertify.alert("操作失败!");
                                }
                            }
                        });
                    }
                });
            });
        });
    </script>
</block>